package com.tywj.panda.home.entity

import android.os.Parcel
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import com.tywj.lib.businessweak.entity.AbsPagingEntity

/**
 * @desc 消息通知列表
 * @author June Yang
 * @date 2020/6/28
 */
class NoticeEntity : AbsPagingEntity<NoticeEntity.DataBean>() {

    class DataBean() : Parcelable {
        var id = ""
        var uid = ""
        var assignNo = ""
        var title = ""
        var type = 0
        var content = ""

        /**
         * read 1 已读 0 未读
         */
        var read = 0

        var createDate = 0L

        constructor(parcel: Parcel) : this() {
            id = parcel.readString() ?: ""
            uid = parcel.readString() ?: ""
            assignNo = parcel.readString() ?: ""
            title = parcel.readString() ?: ""
            type = parcel.readInt()
            content = parcel.readString() ?: ""
            read = parcel.readInt()
            createDate = parcel.readLong()
        }

        override fun writeToParcel(dest: Parcel, flags: Int) {
            dest.writeString(id)
            dest.writeString(uid)
            dest.writeString(assignNo)
            dest.writeString(title)
            dest.writeInt(type)
            dest.writeString(content)
            dest.writeInt(read)
            dest.writeLong(createDate)
        }

        override fun describeContents(): Int = 0

        companion object CREATOR : Parcelable.Creator<DataBean> {
            override fun createFromParcel(parcel: Parcel): DataBean {
                return DataBean(parcel)
            }

            override fun newArray(size: Int): Array<DataBean?> {
                return arrayOfNulls(size)
            }
        }
    }
}